import { defineStore } from 'pinia';

export const useStudentListStore = defineStore('studentList', {
	state: ()=>{
		return {
			students: [],
			currentStudent: {}, // 当前选择的小孩
			isExpire: false, // false: 未过期 true: 过期
		}
	},
	getters: {
		
	},
	//  动作支持异步
	actions: {
		setStudents(res){
			this.students = res;
		},
		setIsExpire(bool){
			this.isExpire = bool
		},
		onselectStudent(student){
			this.currentStudent = student;
		},
		clearAll(){
			this.students = []
		}
	}
});